A Simple Correctness Proof of the Direct-Style Transformation
نویسنده
چکیده
We build on Danvy and Nielsen’s first-order program transformation into continuation-passing style (CPS) to present a new correctness proof of the converse transformation, i.e., a one-pass transformation from CPS back to direct style. Previously published proofs were based on CPS transformations that were either higher-order, noncompositional, or operating in two passes, and were correspondingly complicated to reason about. In contrast, this work is based on a CPS transformation that is first-order, compositional, and that operates in one pass. Therefore the proof simply proceeds by structural induction on syntax.
منابع مشابه
Denotational Style Correctness of a CPS-Transform Based Compiler
Correctness is a crucial property for compilers; programmersrely on it when writing code. Ideally, correctness should beproved. Work on compiler correctness has focused on directtranslation strategies. However, in practice, the continua-tion passing style (CPS) transform (or a variant) is oftenused in the translation process. Here a simple source lan-guage and its CPS-tr...
متن کاملA !rst-order one-pass CPS transformation
We present a new transformation of -terms into continuation-passing style (CPS). This transformation operates in one pass and is both compositional and !rst-order. Previous CPS transformations only enjoyed two out of the three properties of being !rst-order, one-pass, and compositional, but the new transformation enjoys all three properties. It is proved correct directly by structural induction...
متن کاملVerification of Model Transformations
With the increasing use of automatic transformations of models, the correctness of these transformations becomes an increasingly important issue. Especially for model transformation generally defined using abstract description techniques like graph transformations or declarative relational specifications, however, establishing the soundness of those transformations by test-based approaches is n...
متن کاملA First-Order One-Pass CPS Transformation
We present a new transformation of call-by-value lambda-terms into continuation-passing style (CPS). This transformation operates in one pass and is both compositional and first-order. Because it operates in one pass, it directly yields compact CPS programs that are comparable to what one would write by hand. Because it is compositional, it allows proofs by structural induction. Because it is f...
متن کاملA simple correctness proof for magic transformation
The paper presents a simple and concise proof of correctness of the magic transformation. We believe it may provide a useful example of formal reasoning about logic programs. The correctness property concerns the declarative semantics. The proof, however, refers to the operational semantics (LD-resolution) of the source programs. Its conciseness is due to applying a suitable proof method.
متن کامل